package cn.sirun.com.fca.account.loader;

import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.base.ResendResponse;
import cn.sirun.com.fca.account.model.base.SRPEncryptInfo;
import cn.sirun.com.fca.account.model.base.SubmitPhoneRequest;
import cn.sirun.com.fca.account.model.login.LoginResponse;
import cn.sirun.com.fca.account.model.register.RegisterSubmitResponse;
import cn.sirun.com.fca.account.repo.register.RegisterRepository;
import cn.sirun.com.fca.account.repo.reset.ResetRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class CaptchaLoader extends AccountFlowLoader {
    public Observable<BaseResponse<RegisterSubmitResponse>> regSubmitCaptcha(String captcha) {
        return RegisterRepository.getInstance().submitCaptcha(captcha)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ResendResponse>> resendCaptcha() {
        return RegisterRepository.getInstance().resendCaptcha()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<RegisterSubmitResponse>> regSubmitEmialCaptcha(String captcha) {
        return RegisterRepository.getInstance().submitEmailCaptcha(captcha)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ResendResponse>> resendEmailCaptcha() {
        return RegisterRepository.getInstance().resendEmailCaptcha()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SRPEncryptInfo>> resetSubmitCaptcha(String captcha) {
        return ResetRepository.getInstance().submitCaptcha(captcha)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ResendResponse>> resetResendCaptcha() {
        return ResetRepository.getInstance().resend()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<SRPEncryptInfo>> resetSubmitEmialCaptcha(String captcha) {
        return ResetRepository.getInstance().submitEmialCaptcha(captcha)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ResendResponse>> resetEmailResendCaptcha() {
        return ResetRepository.getInstance().emialResend()
                .subscribeOn(Schedulers.io());
    }
}
